package cn.yili12.business.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "chat_user")
@Data
public class UserDb {
    @Id
    private Long id;
    @Column(name = "name", length = 64)
    private String name;
    @Column(name = "sex", length = 2)
    private String sex;
    @Column(name = "phone", length = 20)
    private String phone;
    @Column(name = "password", length = 120)
    private String password;
    @Column(name = "remark", columnDefinition = "text")
    private String remark;
    @Column(name = "org_id")
    private Long orgId;
    @Column(name = "head", length = 64)
    private String head;
    @Transient //非数据库字段
    private Date updateTime;
    @Transient
    private String lastMsg;
    @Transient
    private Integer unread;

    public UserDb() {
    }

    public UserDb(Long id, String name, String sex, String phone, String password, String remark, Long orgId, String head, Date updateTime) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.phone = phone;
        this.password = password;
        this.remark = remark;
        this.orgId = orgId;
        this.head = head;
        this.updateTime = updateTime;
    }
}
